{extend name="public/common"} {block name="body"}
<style>
	#zzc{width:100%;height:100%;background:#000;opacity: .3;position:fixed;top:0;z-index: 4;display:none;}
	#tsk{width:200px;height:75px;background:#ccc;position:fixed;top:300px;left:50%;display:none;margin-left:-100px;z-index:6;line-height:75px;border-radius: 5px;text-align: center;font-size:14px;}
	.father_zzc{width: 420px;height:80%;max-height:600px;position:fixed;top:45px;left:50%;margin-left:-200px;background:#fff;z-index: 5;border-radius: 10px;display:none;overflow: auto;}
	#yzq_content{width: 400px;height:600px;background:#fff;z-index: 6;border-radius: 10px;}
	#yzq_content>i{position:absolute;right:10px;top:5px;font-size:25px;}
	.contain_tr{padding-left:30px;padding-top:28px;}
	.contain_tr h2{padding:0;font-size:22px;}
	.contain_tr h3{padding:10px 0;font-size:16px;color:#666;}
	.contain_tr>.xz_list a{display:inline-block;width:80px;height:28px;margin-left:10px;color:#666;text-align: center;line-height:28px;border-radius: 30px;border:1px solid #ccc;position:relative;}
</style>
<style type="text/css">
	.bg-1 {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}
 .radius:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary {
    color: #fff;
    background-color: #5a98de;
    border-color: #5a98de;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
    <link rel="stylesheet" type="text/css" href="__SYSMET__/h-ui.admin/css/kaiguans.css" />
    
    <div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
    <div id="zzc"></div>
    <div id="tsk"></div>
    <div class="father_zzc">
    	   <div id="yzq_content">
    	        <i class="Hui-iconfont" id="close_yzq">&#xe6a6;</i>
		    	<div class="contain_tr">
		    		<h2 id="yanzhengtitle">两步验证</h2>
		    		<h3>1.在手机上下载并安装Google身份验证器</h3>
		    		<div class="xz_list" style="padding:10px 0;">
		    			<a style="margin-right:50px;" class="down_code" id="Android" href="javascript:;">Android</a>
		    			<a class="down_code" href="javascript:;" id="IOS">IOS</a>
		    		</div>
		    		<div id="hide_code" style="">
		    			<div style="display:block;position:relative;border:1px solid #f00;width:280px;border-radius: 10px;" id="Android_show">
		    				<i style="position:absolute;width:0;height:0;border:10px solid transparent;top:-23px;left:44px;border-bottom:13px solid #f00;"></i>
		    			    <i style="position:absolute;width:0;height:0;border:10px solid transparent;top:-22px;left:44px;border-bottom:15px solid #fff;"></i>
		    				<p style="text-align: center;color:#f00;margin-top:8px;">请使用安卓手机浏览器扫描并下载</p>
		    				<img style="width:140px;display:block;margin:0 auto 10px;" src="__TEMPLATE__/mobile/index/img/Android_code.png" />
		    			</div>
		    			<div style="display:none;position:relative;border:1px solid #f00;width:280px;border-radius: 10px;" id="IOS_show">
		    				<i style="position:absolute;width:0;height:0;border:10px solid transparent;top:-23px;right:76px;border-bottom:13px solid #f00;"></i>
		    			    <i style="position:absolute;width:0;height:0;border:10px solid transparent;top:-22px;right:76px;border-bottom:15px solid #fff;"></i>
		    				<p style="text-align: center;color:#f00;margin-top:8px;">请使用苹果手机扫描并下载</p>
		    				<img style="display:block;width:140px;margin:0 auto 10px;" src="__TEMPLATE__/mobile/index/img/ios_code.png" />
		    			</div>
		    		</div>
		    		<!--<p style="color: #444;">安卓用户也可在各大应用市场搜索[谷歌身份验证器]下载</p>-->
		    		<h3>2.打开Google身份验证器，扫描下方二维码</h3>
		    		<div style="width:280px;"><img style="display:block;width:140px;margin:10px auto;" src="__TEMPLATE__/mobile/index/img/anzhuang_code.png" id="yanzhengimg"/></div>
		    		<div style="margin-top:30px;">
		    			<input style="width:200px;text-indent:10px;height:26px;display:block;float:left;border:1px solid #ccc;border-radius:4px;" type="text" value="123456" id="gg_yzq"/>
		    			<span class="fuzhibtn_copy" style="display:block;width:70px;margin-left:5px;height:28px;float:left;background:#ff6cb5;line-height:28px;border-radius: 4px;color:#fff;text-align: center;">复制</span>
		    		</div>
		    	</div>
		    </div>
    </div>
    
 <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    系统管理
    <span class="c-gray en">&gt;</span>
   
    后台权限
    <span class="c-gray en">&gt;</span>
   
    IP白名单管理
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  <div>
    <h1  style="line-height:50px;float:left;font-size:18px;margin:0 10px;padding:0;padding-left:20px;">IP白名单列表</h1><h1 style="line-height:50px;float:left;font-size:18px;margin:0 10px;padding:0;padding-left:100px;padding-right:20px;color:red;">&nbsp;&nbsp;&nbsp;&nbsp;白名单开关:</h1>
    <div class="toggle toggle--knob" style="margin-top:12px;float:left;">
                        {if condition="$open.open eq 1"}
                        <input type="checkbox" id="toggle--knob-{$open.id}" class="toggle--checkbox" >
                        {else/}
                        <input type="checkbox" id="toggle--knob-{$open.id}" class="toggle--checkbox" checked>
                        {/if}
                        <label class="toggle--btn" for="toggle--knob-{$open.id}" onclick="func(this,{$open.id})">
                            <span class="toggle--feature" data-label-on="on"  data-label-off="off"></span>
                        </label>
                    </div>


    <a style="float:right;margin-right:20px;margin-top:10px;" class="btn btn-primary radius" href="{:url('Rbac/bmd_add')}">添加IP白名单</a>

    
</div>

  <div class="page-container" style="padding-top:0;">
      <div id="tab-system" class="HuiTab">
          <div class="mt-20">
            <table
              class="table table-border table-bordered table-bgt able-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
                  <th>ID</th>
                  
                  <th>IP地址</th>
                  <th>添加人</th>
                  <th>备注</th>
                  <th>添加时间</th>
                  <th>操作</th>
                 
                </tr>
                 {volist name="list" id="v"}
              </thead>
              <tbody>
              
                <tr class="text-c">
                  <td>{$v.id}</td>
                  
                  <td>{$v.ip}</td>
                  <td>{$v.cname}</td>
                  <td>{$v.beizhu}</td>
                  <td>{$v.time|date="Y-m-d H:i:s",###}</td>
                  <td>
                   
                            <a href="/admin/Rbac/bmd_edit?id={$v.id}">编辑</a> |
                        
                            <a href="javascript:;"onclick="if(confirm('是否确认操作？')) {window.location.href='/admin/Rbac/bmd_delete?id={$v.id}'}">删除</a>
                       
                   

                  </td>
                 
                    
                </tr>
               {/volist}
              </tbody>
            </table>
          </div>
      </div>
    </div>
   </div>
    </div>
{/block}
{block name="js"}
 <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript">
    $(function() {
        $('.skin-minimal input').iCheck({
            checkboxClass : 'icheckbox-blue',
            radioClass : 'iradio-blue',
            increaseArea : '20%'
        });
        $("#tab-system").Huitab({
            index : 0
        });
    });


    function func(obj, id) {
        if ($("#toggle--knob-"+id).is(':checked')) {
            var shijian='开启';
        }else{
            var shijian='关闭';
        }
        
        $.ajax({
            type : 'post',
            url : "{:url('rbac/isbaimingdan')}",
            data:{'id':id},
            dataType : 'html',
            success : function(data) {
                
                if(data == 'true'){
                    layer.msg('已'+shijian+'!', {
                        icon : 1,
                        time : 1000
                    });
                    //setTimeout('window.location.reload()',1000);
                }

            },
             error : function(data) {
                 console.log(data.msg);
             },
        });

    }
</script>

{/block}


